package com.study.pattern.observer;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.study.pattern.observer.vo.Lady;
import com.study.pattern.observer.vo.LadyData;

public class LadyRunnable implements Runnable,IUpdatable {

	Logger logger = LoggerFactory.getLogger(this.getClass());
	Lady lady;
	
	public static LadyRunnable newInstance(){
		return new LadyRunnable();
	}
	
	private LadyRunnable(){
		lady= Lady.newInstance();
	}
	
	@Override
	public void run() {
		lady.chant();
	}

	@Override
	public void update(long interval, String msg) {
		lady.update(new LadyData(msg,interval));
	}

	@Override
	public void terminate() {
		lady.terminate();
	}
}
